#include "fileManage.h"

#include <QTabWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "../database/datahandle.h"

FileManage::FileManage(QWidget * parent) : QWidget(parent)
{
    createWin();
    setConnection();
    DataHandle::init();
}

void FileManage::createWin()
{
    m_pTabWin = new QTabWidget;

    m_pInnerManage = new InnerFileManage;
    m_pMonthManage = new MonthFileManage;
    m_pRunLog      = new OperationRunLog;

    m_pTabWin->addTab(m_pInnerManage, "期卡管理");
    m_pTabWin->addTab(m_pMonthManage, "月卡管理");

    QHBoxLayout * pMainLayout = new QHBoxLayout;
    pMainLayout->addWidget(m_pTabWin);
    pMainLayout->addWidget(m_pRunLog);
//    pMainLayout->setMargin(0);
    this->setLayout(pMainLayout);
}

void FileManage::setConnection()
{
    connect(m_pInnerManage,SIGNAL(sigMsg(QString)),m_pRunLog,SLOT(slotRunLot(QString)));
    connect(m_pMonthManage,SIGNAL(sigMsg(QString)),m_pRunLog,SLOT(slotRunLot(QString)));
}
